1. Field of the Invention
The present invention generally relates to an image processing device, an image processing program, and a storage medium, and more particularly, to an image processing device and an image processing program which can adjust a contrast of a black character and a ground in an output image, and a storage medium storing the image processing program.
2. Description of the Related Art
For example, when an image output apparatus deals with an image (a document image) obtained by an image input apparatus, such as a scanner, scanning a printed document intended to communicate contents thereof, the document image is also intended to communicate contents thereof. Therefore, enhancing readability of a text in the output document image is a most important concern upon outputting the document image.
However, for example, when a color image output apparatus, such as a color printer, prints a digital image obtained by using a color image input apparatus, such as a color scanner, to input a document printed with a white ground, printing the image without applying any image processing thereto may cause problems of lowering a contrast between a character and the ground, or coloring a black character or the ground which should originally be black or white, thereby decreasing readability of the text.
These problems occur because colors and gradations are not coordinated between the image input apparatus and the image output apparatus. When image-processing apparatuses, such as the image input apparatus and the image output apparatus, are stand-alone, image-processing algorithms and parameters are often designed according to characteristics of individual apparatuses.
There is a related technology, for example, in which not only a process of emphasizing a pixel corresponding to a black character used in a copier, etc. (for example, disclosed in Japanese Patent No. 2558915 (Japanese Laid-Open Patent Application No. 3-274862), Japanese Laid-Open Patent Application No. 2000-196871, Japanese Laid-Open Patent Application No. 2000-316097, Japanese Laid-Open Patent Application No. 2001-078036, and Japanese Laid-Open Patent Application No. 2001-169133), and a process of specifying a middle-tone area (for example, disclosed in Japanese Patent No. 3158498 (Japanese Laid-Open Patent Application No. 5-014724), Japanese Laid-Open Patent Application No. 2001-036748, Japanese Laid-Open Patent Application No. 2001-144962, and Japanese Laid-Open Patent Application No. 11-220631) are performed, but also a process of performing a tone correction according to a histogram of a pixel signal value (for example, disclosed in Japanese Laid-Open Patent Application No. 2000-013616, Japanese Laid-Open Patent Application No. 2000-013625, Japanese Laid-Open Patent Application No. 2000-115538, Japanese Laid-Open Patent Application No. 2000-242777, Japanese Laid-Open Patent Application No. 2001-045303, Japanese Laid-Open Patent Application No. 2001-148785, Japanese Laid-Open Patent Application No. 2001-167260, Japanese Laid-Open Patent Application No. 2001-189862, Japanese Laid-Open Patent Application No. 2001-189863, Japanese Laid-Open Patent Application No. 2001-197312, Japanese Laid-Open Patent Application No. 2001-222711, and Japanese Laid-Open Patent Application No. 10-283470) is performed. In such a technology, image-processing algorithms and parameters usually depend greatly on color characteristics, resolutions, and frequency characteristics of the input apparatus.
Besides, when a digital image obtained by inputting a printed document from a color image apparatus, such as a scanner, is printed from a color printer, or is displayed on a display, without applying any image processing thereto, this may cause a problematic phenomenon of a non-uniform color of a ground or a background, depending on different characteristics of the scanner (i.e., difference in reading conditions) upon inputting the printed document, or may cause a problematic phenomenon of a so-called “show-through effect” in which contents printed on a backside of the printed document are transparently input. In such cases, the image as a whole often appears uncleanly.
For solving the above-mentioned problematic phenomena in a case where the color of the ground or the background of the subject digital image is white, it is effective to perform a process referred to as “ground removal” or “ground-color removal” which replaces portions of the ground or the background with white.
Well-known examples of the process referred to as “ground removal” or “ground-color removal” include a process of detecting a ground level according to a histogram of a pixel signal value, and thereby removing a ground (for example, disclosed in Japanese Laid-Open Patent Application No. 2000-022971 and Japanese Laid-Open Patent Application No. 2000-078408). When the color of the ground or the background is white, such processing prevents an image deterioration resulting from different characteristics of the scanner (i.e., difference in reading conditions) or from a “show-through effect”.
Besides, there is a process of estimating a background color of a document, and using a difference between the background color and a pixel value of a targeted pixel to change the pixel value of the targeted pixel (for example, disclosed in Japanese Laid-Open Patent Application No. 2000-050083). In this process, a background color is determined by finding a brightest area from histograms of a same color; a background reference color is determined from a color distribution according to a result of discrimination of either of the following four patterns as a background color; and a color of each pixel is adjusted according to a difference between the above-determined reference color and the pixel. In this technology, the four patterns discriminated as a background color are: (1) nearwhite, contone (white-ground copy paper, newspaper printing paper, etc.), (2) near-white, halftone (magazine printing paper etc.), (3) far-white, contone (photograph, colored paper, etc.), and (4) a far-white, halftone (magazine printing paper etc.).
Besides, there is a technology in which a threshold value for judging an area to be either an image area, a ground area or other area is determined by analyzing a distribution state of peaks with respect to a histogram of a gradation distribution; accordingly, an image area is output without any processing, a ground area is converted into a ground color, and the other area is processed according to predetermined conditions, thereby preventing an image deterioration (for example, disclosed in Japanese Laid-Open Patent Application No. 2001-045297).
By the way, the recent spread of network environments has caused circumstances in which an image input via an image apparatus is transmitted to a remote place via a network, and a receiver edits, reuses, prints and/or retransmits the image on a PC (personal computer). In such a network environment, processings, such as edition, reuse, printing, and retransmission are performed to an image input via an unknown image apparatus; this involves new technical problems not considered in the conventional technology as disclose in the above-mentioned Japanese Laid-Open Patent Application documents.
That is, in a network environment, input/output apparatuses have various characteristics; further, when a digital image is input and transmitted from a remote place, an input apparatus is sometimes unknown. In addition, an image-processing system optimal for a certain specific model may not necessarily operate effectively to a model having different characteristics. Therefore, when an image input by an image input apparatus is output by an image output apparatus, precision in recognizing an image may vary, thereby deteriorating a quality of an output image, and decreasing a readability of a text in the output image.
As a countermeasure therefor, an adaptive binarization is effective, as long as problems of the contrast between a character and a ground and coloring of a black character and a ground are concerned. Research and development of binarization technology have been well conducted as a function of preprocessing for an OCR in a document image processing. However, applying a binarization causes a problem that a gradation and a color in a middle-tone area are lost.
This problem may be solved by using a technique of dividing an image into areas, such as a text, a photograph, and a line drawing, which is used in a document image recognition, so as to apply the binarization only for an area in which a black character is written on a white ground. With such a technology, even when an area is incorrectly recognized, edition and correction are easy in OCR whose output forms are text files, such as HTML. However, when a high-definition re-output of a document image is intended, edition and correction of an image may become very complicated when an area is incorrectly recognized.
This necessitates a comprehensive tone correction suitable for a document image, namely a “soft” comprehensive threshold processing, such as changing a white ground into white and changing a black character into black while maintaining a gradation of a middle-tone area. At this point, the comprehensive tone correction, i.e., the “soft” comprehensive threshold processing means a processing such as applying an identical conversion to all of pixels.
Besides, since image input apparatuses have various characteristics, hard-coding of a parameter used as a “predetermined threshold value” must be avoided, for example when performing a processing of substituting white for a color of a pixel having a saturation equal to or smaller than the predetermined threshold value, or when performing a processing of regarding a color of a pixel having a saturation equal to or smaller than the predetermined threshold value as monochrome. Preferably, the parameter (the color of a ground or a black character) determining the above-mentioned processing is calculable adaptively from an image.
Especially, image output apparatuses, such as printers, have various capabilities in representing a highlight color; there is not a uniformity; for example, a same signal is clipped to become white (not printed at all) in one case, and is printed visibly in another case. Therefore, upon the above-described image processing, it is preferred that a user can easily adjust the processing according to characteristics of the image output apparatuses.
Besides, in a color document image, a ground or a background may often have arbitrarily set colors, and a background may often have a complicated composition, including a plurality of background colors.
A histogram obtained by simply examining colors and a gradation distribution in such a color document image including a complicated background composition has a form of “mixture distribution” in which multiple peaks and valleys appear in the histogram. Therefore, it is difficult to conjecture a true background color.
The above-described technology disclosed in Japanese Laid-Open Patent Application No. 2000-022971, Japanese Laid-Open Patent Application No. 2000-078408, or Japanese Laid-Open Patent Application No. 2001-045297 refers to a method of extracting a background or a ground color from a color document image having such a “mixture distribution”. However, since an actually obtained histogram also includes many peaks and valleys deriving from noises, a desired background or ground color cannot always be extracted correctly, but may often be extracted incorrectly.
Besides, in the above-described technology disclosed in Japanese Laid-Open Patent Application No. 2000-050083, a background or a ground is discriminated to be contone or halftone (dots). However, since the discrimination of the halftone dots strongly depends on a frequency characteristic (MTF) of an input apparatus, it is difficult to apply this technology when data is transmitted from a remote place via a network with an input apparatus being unknown.